// DriveNotes. Copyright (c) 2011, Andrei Senchuk. All rights reserved.
package net.taviscaron.drivenotes.web.util;

import com.googlecode.charts4j.Color;
import java.util.Random;

/**
 * Color utils
 * @author Andrei Senchuk
 */
public class ColorUtils {
    private static final Random rnd = new Random(System.currentTimeMillis() % 0xffff);

    public static Color nextColor() {
        int c = rnd.nextInt(0xff) << 16 | rnd.nextInt(0xff) << 8 | rnd.nextInt(0xff);
        StringBuilder sb = new StringBuilder(Integer.toHexString(c));
        while (sb.length() < 6) {
            sb.insert(0, "0");
        }
        return Color.newColor(sb.toString());
    }
}
